NotificationCompat
Helper for accessing features in android.app.Notification.
Types
Link copied to clipboard
Link copied to clipboard
Helper class for generating large-format notifications that include a large image attachment.
Link copied to clipboard
Helper class for generating large-format notifications that include a lot of text.
Link copied to clipboard
class BubbleMetadata
Encapsulates the information needed to display a notification as a bubble.
Link copied to clipboard
Builder class for NotificationCompat objects.
Link copied to clipboard
Helper class for generating large-format notifications that include a caller and required actions, and indicate an incoming call.
Link copied to clipboard
Helper class to add Android Auto extensions to notifications.
Link copied to clipboard
Notification style for custom views that are decorated by the system.
Link copied to clipboard
Link copied to clipboard
Helper class for generating large-format notifications that include a list of (up to 5) strings.
Link copied to clipboard
Helper class for generating large-format notifications that include multiple back-and-forth messages of varying types between any number of people.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
An object that can apply a rich notification style to a Notification.Builder object.
Link copied to clipboard
Helper class to add Android TV extensions to notifications.
Link copied to clipboard
Helper class to add wearable extensions to notifications.
Properties
Link copied to clipboard
If this notification is being shown as a badge, use the icon provided to setLargeIcon to represent this notification.
Link copied to clipboard
If this notification is being shown as a badge, always show as a number.
Link copied to clipboard
If this notification is being shown as a badge, use the icon provided to setSmallIcon to represent this notification.
Link copied to clipboard
Notification category: alarm or timer.
Link copied to clipboard
Notification category: incoming call (voice or video) or similar synchronous communication request.
Link copied to clipboard
Notification category: asynchronous bulk message (email).
Link copied to clipboard
Notification category: error in background operation or authentication status.
Link copied to clipboard
Notification category: calendar event.
Link copied to clipboard
Notification category: temporarily sharing location.
Link copied to clipboard
Notification category: incoming direct message (SMS, instant message, etc.).
Link copied to clipboard
Notification category: missed call.
Link copied to clipboard
Notification category: map turn-by-turn navigation.
Link copied to clipboard
Notification category: progress of a long-running background operation.
Link copied to clipboard
Notification category: promotion or advertisement.
Link copied to clipboard
Notification category: a specific, timely recommendation for a single thing.
Link copied to clipboard
Notification category: user-scheduled reminder.
Link copied to clipboard
Notification category: indication of running background service.
Link copied to clipboard
Notification category: social network or sharing update.
Link copied to clipboard
Notification category: ongoing information about device or contextual status.
Link copied to clipboard
Notification category: running stopwatch.
Link copied to clipboard
Notification category: system or device status update.
Link copied to clipboard
Notification category: media transport control for playback.
Link copied to clipboard
Notification category: voicemail.
Link copied to clipboard
Notification category: tracking a user's workout.
Link copied to clipboard
Value of color equal to 0 (also known as Color.TRANSPARENT), telling the system not to decorate this notification with any special color but instead use default colors when presenting this notification.
Link copied to clipboard
Use all default values (where applicable).
Link copied to clipboard
Use the default notification lights.
Link copied to clipboard
Use the default notification sound.
Link copied to clipboard
Use the default notification vibrate.
Link copied to clipboard
extras key: the color used as a hint for the Answer action button of a android.app.Notification.CallStyle notification.
Link copied to clipboard
extras key: the intent to be sent when the users answers a android.app.Notification.CallStyle notification.
Link copied to clipboard
Keys into the getExtras Bundle: the audio contents of this notification.
Link copied to clipboard
extras key: A content URI pointing to an image that can be displayed in the background when the notification is selected.
Link copied to clipboard
extras key: this is the longer text shown in the big form of a BigTextStyle notification, as supplied to bigText.
Link copied to clipboard
extras key: whether the android.app.Notification.CallStyle notification is for a call that will activate video when answered.
Link copied to clipboard
extras key: the person to be displayed as calling for the android.app.Notification.CallStyle notification.
Link copied to clipboard
extras key: the person to be displayed as calling for the android.app.Notification.CallStyle notification, for Android versions before the Person class was introduced.
Link copied to clipboard
extras key: the type of call represented by the android.app.Notification.CallStyle notification.
Link copied to clipboard
Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.
Link copied to clipboard
Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.
Link copied to clipboard
extras key: whether the chronometer set on the notification should count down instead of counting up.
Link copied to clipboard
extras key: whether the notification should be colorized as supplied to setColorized.
Link copied to clipboard
extras key: the indices of actions to be shown in the compact view, as supplied to (e.g.
Link copied to clipboard
extras key: A string representing the name of the specific NotificationCompat.Style used to create this notification.
Link copied to clipboard
extras key: a String to be displayed as the title to a conversation represented by a MessagingStyle.
Link copied to clipboard
extras key: the color used as a hint for the Decline or Hang Up action button of a android.app.Notification.CallStyle notification.
Link copied to clipboard
extras key: the intent to be sent when the users declines a android.app.Notification.CallStyle notification.
Link copied to clipboard
extras key: the intent to be sent when the users hangs up a android.app.Notification.CallStyle notification.
Link copied to clipboard
Key for compat's getConversationTitle.
Link copied to clipboard
extras key: an array of historicMessagingStyle.Message bundles provided by a MessagingStyle notification.
Link copied to clipboard
extras key: this is a small piece of additional text as supplied to setContentInfo.
Link copied to clipboard
extras key: whether the NotificationCompat.MessagingStyle notification represents a group conversation.
Link copied to clipboard
extras key: this is a bitmap to be used instead of the small icon when showing the notification payload, as supplied to setLargeIcon.
Link copied to clipboard
extras key: this is a bitmap to be used instead of the one from setLargeIcon when the notification is shown in its expanded form, as supplied to bigLargeIcon.
Link copied to clipboard
Notification key: A android.media.session.MediaSession.Token associated with a android.app.Notification.MediaStyle notification.
Link copied to clipboard
extras key: an array of MessagingStyle.Message bundles provided by a android.app.Notification.MessagingStyle notification.
Link copied to clipboard
extras key: the person to display for all messages sent by the user, including direct replies to MessagingStyle notifications.
Link copied to clipboard
Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.
Link copied to clipboard
Optional extra for INTENT_CATEGORY_NOTIFICATION_PREFERENCES.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
extras key: this is a bitmap to be shown in BigPictureStyle expanded notifications, supplied to bigPicture.
Link copied to clipboard
extras key: this is a content description of the big picture supplied from bigPicture, supplied to setContentDescription.
Link copied to clipboard
extras key: this is an Icon of an image to be shown in Notification.BigPictureStyle expanded notifications, supplied to bigPicture.
Link copied to clipboard
extras key: this is the progress value supplied to setProgress.
Link copied to clipboard
extras key: whether the progress bar is indeterminate, supplied to setProgress.
Link copied to clipboard
extras key: this is the maximum value supplied to setProgress.
Link copied to clipboard
extras key: this is the remote input history, as supplied to setRemoteInputHistory.
Link copied to clipboard
extras key: the username to be displayed for all messages sent by the user including direct replies MessagingStyle notification.
Link copied to clipboard
extras key: this is a boolean to indicate that the big picture is to be shown in the collapsed state of a BigPictureStyle notification.
Link copied to clipboard
extras key: whether the when field set using setWhen should be shown as a count-up timer (specifically a android.widget.Chronometer) instead of a timestamp, as supplied to setUsesChronometer.
Link copied to clipboard
Link copied to clipboard
extras key: this is the resource ID of the notification's main small icon, as supplied to setSmallIcon.
Link copied to clipboard
extras key: this is a third line of text, as supplied to setSubText.
Link copied to clipboard
extras key: this is a line of summary information intended to be shown alongside expanded notifications, as supplied to (e.g.
Link copied to clipboard
extras key: A string representing the name of the specific android.app.Notification.Style used to create this notification.
Link copied to clipboard
extras key: this is the main text payload, as supplied to setContentText.
Link copied to clipboard
extras key: An array of CharSequences to show in InboxStyle expanded notifications, each of which was supplied to addLine.
Link copied to clipboard
extras key: this is the title of the notification, as supplied to setContentTitle.
Link copied to clipboard
extras key: this is the title of the notification when shown in expanded form, e.g.
Link copied to clipboard
extras key: the icon to be displayed as a verification status of the caller on a android.app.Notification.CallStyle notification.
Link copied to clipboard
extras key: the icon to be displayed as a verification status of the caller on a android.app.Notification.CallStyle notification, for Android versions before the Icon class was introduced.
Link copied to clipboard
extras key: the text to be displayed as a verification status of the caller on a android.app.Notification.CallStyle notification.
Link copied to clipboard
Bit set in the Notification flags field if the notification should be canceled when it is clicked by the user.
Link copied to clipboard
Bit set in the Notification flags field if this notification is showing as a bubble.
Link copied to clipboard
Bit set in the Notification flags field if this notification represents a currently running service.
Link copied to clipboard
Bit set in the Notification flags field if this notification is the group summary for a group of notifications.
Link copied to clipboard
Obsolete flag indicating high-priority notifications; use the priority field instead.
Link copied to clipboard
Bit set in the Notification flags field if the audio will be repeated until the notification is cancelled or the notification window is opened.
Link copied to clipboard
Bit set in the Notification flags field if this notification is relevant to the current device only and it is not recommended that it bridge to other devices.
Link copied to clipboard
Bit set in the Notification flags field if the notification should not be canceled when the user clicks the Clear all button.
Link copied to clipboard
Bit set in the Notification flags field if this notification is in reference to something that is ongoing, like a phone call.
Link copied to clipboard
Bit set in the Notification flags field if the notification's sound, vibrate and ticker should only be played if the notification is not already showing.
Link copied to clipboard
Bit set in the Notification flags field when LEDs should be turned on for this notification.
Link copied to clipboard
Constant for setForegroundServiceBehavior.
Link copied to clipboard
Constant for setForegroundServiceBehavior.
Link copied to clipboard
Constant for setForegroundServiceBehavior.
Link copied to clipboard
Constant for setGroupAlertBehavior, meaning that all notifications in a group with sound or vibration ought to make sound or vibrate (respectively), so this notification will not be muted when it is in a group.
Link copied to clipboard
Constant for setGroupAlertBehavior, meaning that the summary notification in a group should be silenced (no sound or vibration) even if they would otherwise make sound or vibrate.
Link copied to clipboard
Constant for setGroupAlertBehavior, meaning that all children notification in a group should be silenced (no sound or vibration) even if they would otherwise make sound or vibrate.
Link copied to clipboard
Constant for the group key that's added to notifications that are not already grouped when setNotificationSilent is used when SDK_INT is >= O.
Link copied to clipboard
val INTENT_CATEGORY_NOTIFICATION_PREFERENCES: String = "android.intent.category.NOTIFICATION_PREFERENCES"
An activity that provides a user interface for adjusting notification preferences for its containing application.
Link copied to clipboard
Maximum number of (generic) action buttons in a notification (contextual action buttons are handled separately).
Link copied to clipboard
Default notification priority for setPriority.
Link copied to clipboard
Higher notification priority for setPriority, for more important notifications or alerts.
Link copied to clipboard
Lower notification priority for setPriority, for items that are less important.
Link copied to clipboard
Highest notification priority for setPriority, for your application's most important items that require the user's prompt attention or input.
Link copied to clipboard
Lowest notification priority for setPriority; these items might not be shown to the user except under special circumstances, such as detailed notification logs.
Link copied to clipboard
Use this constant as the value for audioStreamType to request that the default stream type for notifications be used.
Link copied to clipboard
Notification visibility: Show this notification on all lockscreens, but conceal sensitive or private information on secure lockscreens.
Link copied to clipboard
Notification visibility: Show this notification in its entirety on all lockscreens.
Link copied to clipboard
Notification visibility: Do not reveal any part of this notification on a secure lockscreen.
Functions
Link copied to clipboard
open fun getAction(@NonNull notification: Notification, actionIndex: Int): NotificationCompat.Action
Get an action on this notification in a backwards compatible manner.
Link copied to clipboard
Get the number of actions in this notification in a backwards compatible manner.
Link copied to clipboard
Returns whether the platform is allowed (by the app developer) to generate contextual actions for this notification.
Link copied to clipboard
Get the value provided to setAutoCancel
Link copied to clipboard
Returns what icon should be shown for this notification if it is being displayed in a Launcher that supports badging.
Link copied to clipboard
Get the BubbleMetadata for a notification that will be used to display app content in a floating window over the existing foreground activity.
Link copied to clipboard
Get the category of this notification in a backwards compatible manner.
Link copied to clipboard
Link copied to clipboard
Returns the content info provided to setContentInfo.
Link copied to clipboard
Returns the content text provided to setContentText.
Link copied to clipboard
Returns the content title provided to setContentTitle.
Link copied to clipboard
Returns which type of notifications in a group are responsible for audibly alerting the user.
Link copied to clipboard
Returns the invisible actions contained within the given notification.
Link copied to clipboard
Get whether or not this notification is only relevant to the current device.
Link copied to clipboard
Gets the LocusIdCompat associated with this notification.
Link copied to clipboard
Get the value provided to setOngoing
Link copied to clipboard
Get the value provided to setOnlyAlertOnce
Link copied to clipboard
Get the value provided to setVisibility
Link copied to clipboard
Returns the settings text provided to setSettingsText.
Link copied to clipboard
Returns the id that this notification supersedes, if any.
Link copied to clipboard
Get the value provided to setShowWhen
Link copied to clipboard
Get a sort key that orders this notification among other notifications from the same package.
Link copied to clipboard
Returns the sub text provided to setSubText.
Link copied to clipboard
Returns the time at which this notification should be canceled by the system, if it's not canceled already.
Link copied to clipboard
Get the value provided to setUsesChronometer
Link copied to clipboard
Get the value provided to setVisibility
Link copied to clipboard
Get whether this notification to be the group summary for a group of notifications.
Link copied to clipboard